package com.example.demo.mapper;

import com.example.demo.entity.blog;
import com.example.demo.entity.tags;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface blogMapper {
    //根据类型查询博客
    public List<blog> selectblogBytype(String type);

    //查询用户的所有博客
    public List<blog> selectblogBymailbox(String mailbox);
    //查询所有博客
    public List <blog> selectAllblog();

    //根据id查询博客
    public blog selectblogByid(int id);

    //根据类型，邮箱查询博客
    public List<blog> selectother(@Param("type") int type,@Param("mailbox") String mailbox);

    //增加博客
    public void insertblog(blog blog);

    //根据id查询blog
    public blog selectblog(int id);
    //点赞
    public void fabulous(int id,int num);
    //收藏
    public void collection(int id,int num);
    //浏览
    public void browse(int id,int num);
    //删除blog
    public  void deleteblogbyid(int id);
}
